using Pathfinding;
using UnityEngine;


public class DebugTargetPos : MonoBehaviour
{
    public Seeker seeker;
    
    public void Update () {

        if (Input.GetKeyDown(KeyCode.Space))
        {
            // Start to calculate a new path to the targetPosition object, return the result to the OnPathComplete method.
            // Path requests are asynchronous, so when the OnPathComplete method is called depends on how long it
            // takes to calculate the path. Usually it is called the next frame.
            seeker.StartPath(seeker.transform.position, transform.position, OnPathComplete);
        }
    }

    public void OnPathComplete (Path p) {
        Debug.Log("Yay, we got a path back. Did it have an error? " + p.error);
    }
}
